<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\Http;

class testAnKangApi extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'test:akapi';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        $sign = Http::get('http://117.34.118.31:8101/api/drv/sign/list', [
            'date' => '2020-08-01',
        ]);
        $this->info('-sign: '.$sign->body().PHP_EOL);

        $mileage = Http::get('http://117.34.118.31:8101/api/bus/mileage/list', [
            'date' => '2020-08-01',
        ]);
        $this->info('-mileage: '.$mileage->body().PHP_EOL);

        $apply = Http::get('http://117.34.118.31:8101/api/drv/apply/list', [
            'date' => '2020-08-01',
        ]);
        $this->info('-apply: '.$apply->body().PHP_EOL);
    }
}
